//index.js
//获取应用实例
var indexData = require("../../data/index.js");
const app = getApp()

Page({
  data: {
    swiper: [],
    iconMenu:[],
    newGoods:[],
    hotGoods:[]
  },

  //事件处理函数
  onSearchFocus: function(){
    wx.navigateTo({
      url: '/pages/search/search',
    })
  },

  //获得首页数据
  getIndexData:function(){
    this.setData({
      swiper: indexData.swiper,
      iconMenu: indexData.iconMenu,
      newGoods: indexData.newGoods,
      hotGoods: indexData.hotGoods
    });
  },

  onLoad: function () {
    this.getIndexData();
  },
  onShow: function () {
  }
})
